FROM debian:buster-slim
COPY yuyao.py yyrc.py zxhr.py send_to_mail.py requirments.txt launch.sh createdatabase.sql /home/
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list\
    && sed -i 's/deb http:\/\/security/# deb http:\/\//g' /etc/apt/sources.list\
    && apt-get update\
    && apt-get install -y\
      mariadb-server mariadb-client python3 git python3-pip libxml2-dev libxslt1-dev liblzma-dev libzip-dev cron\
    && pip3 install -r /home/requirments.txt -i https://pypi.tuna.tsinghua.edu.cn/simple\
    && service cron restart\
    && echo "*/5 * * * * bash /home/launch.sh" | crontab\
    && service mysql restart\
    && mysql -uroot < /home/createdatabase.sql

CMD ["bash"]

